#include "CBL_TestManager.h"
#include <iostream>

CB_SUBNAMESPACE_START(Test)

// ---------------------------------------------------------------------------------------------------------------------

CTestManager::CTestManager()
{
}

// ---------------------------------------------------------------------------------------------------------------------

CTestManager::~CTestManager()
{
}

// ---------------------------------------------------------------------------------------------------------------------

void CTestManager::AddTest(ITestObject* _pTest)
{
	m_Tests.push_back(_pTest);
}

// ---------------------------------------------------------------------------------------------------------------------

void CTestManager::RunTests()
{
	const CTestVector::iterator EndIter = m_Tests.end();
	for (	CTestVector::iterator Iter = m_Tests.begin();
			Iter != EndIter;
			++Iter)
	{
		if ((*Iter)->Run())
		{
			std::cout << "succeeded: \"" << (*Iter)->GetName() << "\"." << std::endl << std::endl;
		}
		else
		{
			std::cout << "FAILED: \"" << (*Iter)->GetName() << "\"." << std::endl << std::endl;
		}
	}
}

CB_SUBNAMESPACE_END